package cs543.library.rmi;

import java.util.HashMap;

public class RmiClientRegistry {
	static HashMap<String, Object> directory = null;
	
	public RmiClientRegistry () {
		if (directory == null)
			directory = new HashMap<String, Object> ();
	}
	
	public void register (String name, Object clazz) {
		if (directory.containsValue (name)) directory.remove (name);
		directory.put (name, clazz);
	}
	
	@SuppressWarnings("unchecked")
	public <T> T lookup (String name) {
		return (T) directory.get (name);
	}
}
